//
//  Waiting.m
//  Cabinet
//
//  Created by Florent Montsegur on 15/05/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Waiting.h"


@implementation Waiting
@synthesize mLabel;
@synthesize mProgressBar;
@synthesize  UserData;


- (id)initWithWindow:(NSWindow *)window
{
    self = [super initWithWindow:window];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}

- (NSString*)windowNibName
{
	return @"Waiting";
}

- (void)withParentWindow:parentWindow
{
	NSWindow* window = [self window];
	
	
	[NSApp beginSheet:window modalForWindow:parentWindow modalDelegate:nil didEndSelector:nil contextInfo:nil];
	[NSApp runModalForWindow:window];
	// sheet is up now...
	
	[NSApp endSheet:window];
	[window orderOut:self];
	
}

- (void) setMessage:(NSString*)aMessage
{
    mMessage = aMessage;
}

- (void) end {
	[[self window] orderOut:nil];
	[NSApp stopModal];
}


- (void)windowDidLoad
{
    [super windowDidLoad];
    [mProgressBar startAnimation:self];
    // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
    
    [mLabel setStringValue:mMessage];
}

- (void) setFileType:(int)aTypeFile
{
    mTypeFile = aTypeFile;
}

- (int) typeFile
{
    return mTypeFile;
}


@end
